package com.sike.netty.im.server.service;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;


public class BeanFactory {
    private static Map<Class,Object> beanMap = new ConcurrentHashMap<>();

    static {
        beanMap.put(SessionService.class,new SessionService());
        beanMap.put(GroupService.class,new GroupService());
    }

    /**
     * 获取服务的 bean 实例
     * @param clasz
     * @return
     */
    public static Object getServiceBean(Class clasz) {
        return beanMap.get(clasz);
    }
}
